﻿#pragma once

#include <stdio.h>

#include <iostream>

#include "MyPrtFns.h"
#include "MyTypes.h"

//============================================================== run test, main
static int order = 0;

using TestFn_i64 = i64 (*)();
using TestFn_i8 = i8 (*)();
using TestFn_int = int (*)();
using TestFn_void = void (*)();

template <class T>
void runTest(T _fn)
{
    //std::cout << std::endl;
    //sepln();
    MY_SEP_TEST;
    _fn();
    order++;
}

template <class T, class... Args>
void runTest(T func, Args&&... args)
{
    //std::cout << std::endl;
    //sepln();
    MY_SEP_TEST;
    func((std::forward<Args>(args), ...));
    order++;
}

// 测试单元模板
#if 0
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx std::optional
namespace te18_1
{
    //-----------------------------------
    MY_FIN_I8 tt1()
    {
        MY_ECHOFUNPATH;

        auto ss = [](NoDeleter* ptr) { MyfPrtln("Run custom deleter."); };
        std::unique_ptr<NoDeleter, decltype(ss)> no_del(new NoDeleter(), ss);
        no_del->prt();

        return 0;
    }

}  // namespace te18_10
#endif